/**
 * 
 */
package denaris.midlet;

import javax.microedition.lcdui.Graphics;

/**
 * The base class for all screens in Denaris. Every class that inherits
 * AbstractThreadedScreen MUST implement the singleton pattern (i.e. create a
 * static instance member).
 * 
 * @author stkl23
 *
 */
public abstract class AbstractScreen {
	/**
	 * Initialize the screen. This method is called everytime the screen is
	 * invoked
	 */
	protected abstract void initialize();

	/**
	 * This is the central paint-Method which MUST use the given graphics object
	 * to draw to. By doing this other screens have the possibility to use this
	 * screens output.
	 */
	public abstract void paintScreenToBuffer(Graphics g);

	/**
	 * Call this method to make sure EVERY part of the screen is drawn to the
	 * Buffer. The game screen for example only updates the map part in
	 * paintScreenToBuffer but would draw also the scorebar and the statusbar in
	 * this method.
	 */
	public abstract void doFullRepaintToBuffer(Graphics g);
	
	/**
	 * This method is called from the GameCanvases run()-method once every frame.
	 */
	public abstract void update();
}
